\(\int \frac {(d+e x) (a+b \log (c x^n))}{x^2} \, dx\) [6]

   Optimal result
   Rubi [A] (verified)
   Mathematica [A] (verified)
   Maple [A] (verified)
   Fricas [A] (verification not implemented)
   Sympy [A] (verification not implemented)
   Maxima [A] (verification not implemented)
   Giac [A] (verification not implemented)
   Mupad [B] (verification not implemented)

Optimal result

Integrand size = 19, antiderivative size = 48 \[ \int \frac {(d+e x) \left (a+b \log \left (c x^n\right )\right )}{x^2} \, dx=-\frac {b d n}{x}-\frac {d \left (a+b \log \left (c x^n\right )\right )}{x}+\frac {e \left (a+b \log \left (c x^n\right )\right )^2}{2 b n} \]

[Out]

-b*d*n/x-d*(a+b*ln(c*x^n))/x+1/2*e*(a+b*ln(c*x^n))^2/b/n

Rubi [A] (verified)

Time = 0.04 (sec) , antiderivative size = 50, normalized size of antiderivative = 1.04, number of steps used = 4, number of rules used = 4, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.211, Rules used = {45, 2372, 14, 2338} \[ \int \frac {(d+e x) \left (a+b \log \left (c x^n\right )\right )}{x^2} \, dx=-\frac {d \left (a+b \log \left (c x^n\right )\right )}{x}+e \log (x) \left (a+b \log \left (c x^n\right )\right )-\frac {b d n}{x}-\frac {1}{2} b e n \log ^2(x) \]

[In]

Int[((d + e*x)*(a + b*Log[c*x^n]))/x^2,x]

[Out]

-((b*d*n)/x) - (b*e*n*Log[x]^2)/2 - (d*(a + b*Log[c*x^n]))/x + e*Log[x]*(a + b*Log[c*x^n])

Rule 14

Int[(u_)*((c_.)*(x_))^(m_.), x_Symbol] :> Int[ExpandIntegrand[(c*x)^m*u, x], x] /; FreeQ[{c, m}, x] && SumQ[u]
 &&  !LinearQ[u, x] &&  !MatchQ[u, (a_) + (b_.)*(v_) /; FreeQ[{a, b}, x] && InverseFunctionQ[v]]

Rule 45

Int[((a_.) + (b_.)*(x_))^(m_.)*((c_.) + (d_.)*(x_))^(n_.), x_Symbol] :> Int[ExpandIntegrand[(a + b*x)^m*(c + d
*x)^n, x], x] /; FreeQ[{a, b, c, d, n}, x] && NeQ[b*c - a*d, 0] && IGtQ[m, 0] && ( !IntegerQ[n] || (EqQ[c, 0]
&& LeQ[7*m + 4*n + 4, 0]) || LtQ[9*m + 5*(n + 1), 0] || GtQ[m + n + 2, 0])

Rule 2338

Int[((a_.) + Log[(c_.)*(x_)^(n_.)]*(b_.))/(x_), x_Symbol] :> Simp[(a + b*Log[c*x^n])^2/(2*b*n), x] /; FreeQ[{a
, b, c, n}, x]

Rule 2372

Int[((a_.) + Log[(c_.)*(x_)^(n_.)]*(b_.))*(x_)^(m_.)*((d_) + (e_.)*(x_)^(r_.))^(q_.), x_Symbol] :> With[{u = I
ntHide[x^m*(d + e*x^r)^q, x]}, Dist[a + b*Log[c*x^n], u, x] - Dist[b*n, Int[SimplifyIntegrand[u/x, x], x], x]]
 /; FreeQ[{a, b, c, d, e, n, r}, x] && IGtQ[q, 0] && IntegerQ[m] &&  !(EqQ[q, 1] && EqQ[m, -1])

Rubi steps \begin{align*} \text {integral}& = -\frac {d \left (a+b \log \left (c x^n\right )\right )}{x}+e \log (x) \left (a+b \log \left (c x^n\right )\right )-(b n) \int \frac {-d+e x \log (x)}{x^2} \, dx \\ & = -\frac {d \left (a+b \log \left (c x^n\right )\right )}{x}+e \log (x) \left (a+b \log \left (c x^n\right )\right )-(b n) \int \left (-\frac {d}{x^2}+\frac {e \log (x)}{x}\right ) \, dx \\ & = -\frac {b d n}{x}-\frac {d \left (a+b \log \left (c x^n\right )\right )}{x}+e \log (x) \left (a+b \log \left (c x^n\right )\right )-(b e n) \int \frac {\log (x)}{x} \, dx \\ & = -\frac {b d n}{x}-\frac {1}{2} b e n \log ^2(x)-\frac {d \left (a+b \log \left (c x^n\right )\right )}{x}+e \log (x) \left (a+b \log \left (c x^n\right )\right ) \\ \end{align*}

Mathematica [A] (verified)

Time = 0.02 (sec) , antiderivative size = 48, normalized size of antiderivative = 1.00 \[ \int \frac {(d+e x) \left (a+b \log \left (c x^n\right )\right )}{x^2} \, dx=-\frac {b d n}{x}-\frac {d \left (a+b \log \left (c x^n\right )\right )}{x}+\frac {e \left (a+b \log \left (c x^n\right )\right )^2}{2 b n} \]

[In]

Integrate[((d + e*x)*(a + b*Log[c*x^n]))/x^2,x]

[Out]

-((b*d*n)/x) - (d*(a + b*Log[c*x^n]))/x + (e*(a + b*Log[c*x^n])^2)/(2*b*n)

Maple [A] (verified)

Time = 0.08 (sec) , antiderivative size = 53, normalized size of antiderivative = 1.10

method result size
parallelrisch \(\frac {2 \ln \left (x \right ) x a e n +b e \ln \left (c \,x^{n}\right )^{2} x -2 \ln \left (c \,x^{n}\right ) b d n -2 b d \,n^{2}-2 a d n}{2 x n}\) \(53\)
risch \(-\frac {b \left (-e x \ln \left (x \right )+d \right ) \ln \left (x^{n}\right )}{x}-\frac {i \ln \left (x \right ) \pi b e \,\operatorname {csgn}\left (i c \right ) \operatorname {csgn}\left (i x^{n}\right ) \operatorname {csgn}\left (i c \,x^{n}\right ) x -i \ln \left (x \right ) \pi b e \,\operatorname {csgn}\left (i c \right ) \operatorname {csgn}\left (i c \,x^{n}\right )^{2} x -i \ln \left (x \right ) \pi b e \,\operatorname {csgn}\left (i x^{n}\right ) \operatorname {csgn}\left (i c \,x^{n}\right )^{2} x +i \ln \left (x \right ) \pi b e \operatorname {csgn}\left (i c \,x^{n}\right )^{3} x -i \pi b d \,\operatorname {csgn}\left (i c \right ) \operatorname {csgn}\left (i x^{n}\right ) \operatorname {csgn}\left (i c \,x^{n}\right )+i \pi b d \,\operatorname {csgn}\left (i c \right ) \operatorname {csgn}\left (i c \,x^{n}\right )^{2}+i \pi b d \,\operatorname {csgn}\left (i x^{n}\right ) \operatorname {csgn}\left (i c \,x^{n}\right )^{2}-i \pi b d \operatorname {csgn}\left (i c \,x^{n}\right )^{3}+b e n \ln \left (x \right )^{2} x -2 \ln \left (x \right ) \ln \left (c \right ) b e x -2 \ln \left (x \right ) a e x +2 d b \ln \left (c \right )+2 b d n +2 a d}{2 x}\) \(250\)

[In]

int((e*x+d)*(a+b*ln(c*x^n))/x^2,x,method=_RETURNVERBOSE)

[Out]

1/2/x*(2*ln(x)*x*a*e*n+b*e*ln(c*x^n)^2*x-2*ln(c*x^n)*b*d*n-2*b*d*n^2-2*a*d*n)/n

Fricas [A] (verification not implemented)

none

Time = 0.29 (sec) , antiderivative size = 50, normalized size of antiderivative = 1.04 \[ \int \frac {(d+e x) \left (a+b \log \left (c x^n\right )\right )}{x^2} \, dx=\frac {b e n x \log \left (x\right )^{2} - 2 \, b d n - 2 \, b d \log \left (c\right ) - 2 \, a d + 2 \, {\left (b e x \log \left (c\right ) - b d n + a e x\right )} \log \left (x\right )}{2 \, x} \]

[In]

integrate((e*x+d)*(a+b*log(c*x^n))/x^2,x, algorithm="fricas")

[Out]

1/2*(b*e*n*x*log(x)^2 - 2*b*d*n - 2*b*d*log(c) - 2*a*d + 2*(b*e*x*log(c) - b*d*n + a*e*x)*log(x))/x

Sympy [A] (verification not implemented)

Time = 1.64 (sec) , antiderivative size = 53, normalized size of antiderivative = 1.10 \[ \int \frac {(d+e x) \left (a+b \log \left (c x^n\right )\right )}{x^2} \, dx=- \frac {a d}{x} + a e \log {\left (x \right )} + b d \left (- \frac {n}{x} - \frac {\log {\left (c x^{n} \right )}}{x}\right ) - b e \left (\begin {cases} - \log {\left (c \right )} \log {\left (x \right )} & \text {for}\: n = 0 \\- \frac {\log {\left (c x^{n} \right )}^{2}}{2 n} & \text {otherwise} \end {cases}\right ) \]

[In]

integrate((e*x+d)*(a+b*ln(c*x**n))/x**2,x)

[Out]

-a*d/x + a*e*log(x) + b*d*(-n/x - log(c*x**n)/x) - b*e*Piecewise((-log(c)*log(x), Eq(n, 0)), (-log(c*x**n)**2/
(2*n), True))

Maxima [A] (verification not implemented)

none

Time = 0.20 (sec) , antiderivative size = 49, normalized size of antiderivative = 1.02 \[ \int \frac {(d+e x) \left (a+b \log \left (c x^n\right )\right )}{x^2} \, dx=\frac {b e \log \left (c x^{n}\right )^{2}}{2 \, n} + a e \log \left (x\right ) - \frac {b d n}{x} - \frac {b d \log \left (c x^{n}\right )}{x} - \frac {a d}{x} \]

[In]

integrate((e*x+d)*(a+b*log(c*x^n))/x^2,x, algorithm="maxima")

[Out]

1/2*b*e*log(c*x^n)^2/n + a*e*log(x) - b*d*n/x - b*d*log(c*x^n)/x - a*d/x

Giac [A] (verification not implemented)

none

Time = 0.34 (sec) , antiderivative size = 55, normalized size of antiderivative = 1.15 \[ \int \frac {(d+e x) \left (a+b \log \left (c x^n\right )\right )}{x^2} \, dx=\frac {1}{2} \, b e n \log \left (x\right )^{2} - b d n {\left (\frac {\log \left (x\right )}{x} + \frac {1}{x}\right )} + b e \log \left (c\right ) \log \left ({\left | x \right |}\right ) + a e \log \left ({\left | x \right |}\right ) - \frac {b d \log \left (c\right )}{x} - \frac {a d}{x} \]

[In]

integrate((e*x+d)*(a+b*log(c*x^n))/x^2,x, algorithm="giac")

[Out]

1/2*b*e*n*log(x)^2 - b*d*n*(log(x)/x + 1/x) + b*e*log(c)*log(abs(x)) + a*e*log(abs(x)) - b*d*log(c)/x - a*d/x

Mupad [B] (verification not implemented)

Time = 0.34 (sec) , antiderivative size = 59, normalized size of antiderivative = 1.23 \[ \int \frac {(d+e x) \left (a+b \log \left (c x^n\right )\right )}{x^2} \, dx=\ln \left (x\right )\,\left (a\,e+b\,e\,n\right )-\frac {a\,d+b\,d\,n}{x}-\frac {\ln \left (c\,x^n\right )\,\left (b\,d+b\,e\,x\right )}{x}+\frac {b\,e\,{\ln \left (c\,x^n\right )}^2}{2\,n} \]

[In]

int(((a + b*log(c*x^n))*(d + e*x))/x^2,x)

[Out]

log(x)*(a*e + b*e*n) - (a*d + b*d*n)/x - (log(c*x^n)*(b*d + b*e*x))/x + (b*e*log(c*x^n)^2)/(2*n)